CosmoSim is a simulator for gravitational lensing.
The main simulator application is the datagen.py script.
The simples run of the simulator specifies a CSV file with parameters, and generates the distorted image for each row.
python3 CosmoSimPy/datagen.py --csvfile Dataset/debug.csv
--directory dir : directory path for output files--maxcount n: Maximum number of images to generate--reflines : Add reference (axes) lines to the image--criticalcurves : Add critical curves to the distorted image--centred : centre image on the centre of light--nterms : Number of Roulettes terms--imagesize : image size for calculations--cropsize : Final image size--maskradius : Set explicit masking radius--mask : Mask out the convergence circle--showmask : Mark the convergence circle--maskscale : Scaling factor for the mask radiusThese options create additional image files at different stages of the simulation
--original : Also write original image before centring--apparent : write apparent image--actual : write actual imageParameters which are not set in the CSV file, can be set on the command line. The CSV file takes precedence though.
--lensmode m : lens model--modelmode m : simulation model--sourcemode m : source model--sampled : Use sample lens model--config : Configuration. Specifying Simulation and Lens Model together.--x x --y y : Set the source position in Cartesian co-ordinates.--x x --phi phi : Set the source position in Polar co-ordinates.
If both --y and --phi are specified, --y takes precedence.--sigma : source size (sigma)--sigma2 : secondary source size (sigma2) for elliptical sources--theta : source rotation angle (theta)--chi : lens distance ratio ($\chi$)--einsteinradius : Einstein radius--ratio : Ratio (usually Elliptic eccentricity) for the lens--orientation : Orientation of the lens--outfile : Output file for roulette amplitudes, see
Roulette ResimulationThese options are not used in current research and have not been tested in recent versions, if they have been implemented at all.
--name : simulation name--components n : Number of components for joined image--join : Join several images from different viewpoints--amplitudes : Amplitudes input file--psiplot' : Plot lens potential as 3D surface--kappaplot : Plot mass distribution as 3D surface--family : Several images moving the viewpoint--no-xireference calculate roulette amplitudes in the centre of light,
instead of the source centre
datagen.py.--centred, lest the origin be the origin and the model collapse--xireference is the default, using the same expansion point
as the original simulation.It is also possible to generate a single image by ommitting the CSV file and giving all parameters on the command line.